Buffering input/output (I/O) is common way to improve performance when accessing secondary storage. Buffered I/O are in contrast to Direct I/O. Buffered I/O are read and write operations requested by an application via subroutines where the source or result of the I/O operation are cached in a main memory before being sent to the requesting application, while direct I/O are read and write operations via system calls where the data is transferred directly between the storage device and the application programs memory without being copied through extraneous buffers.
The principal method of buffering I/O is by linking to standard libraries that buffer I/O requests when an application is being compiled. It is common for the standard libraries provided by an operating system to provide buffered I/O to applications that request POSIX compliant I/O operations. For example, in the Linux kernel, POSIX compliant I/O requests to secondary storage are buffered through the gLIBC library. By doing so, the Linux kernel obscures the use of buffered I/O by not requiring applications to specifically link to libraries that provide buffered I/O. Hence, the buffered I/O provided by the Linux kernel is both universal and relinkless, in that applications do not need to be relinked to a standard IO library to utilize buffered IO. Universal and relinkless buffered I/O provided by an operating system allow application developers to ignore the complexity common to maintaining an I/O cache and still achieve the benefits of maintaining an I/O cache, but there are some pitfalls.
When an operating system buffers I/O automatically, the buffers are treated in a uniform manner. A user cannot adjust the operating parameters of the buffer. This is especially detrimental in High Performance Computing and High Performance Technical Computing (collectively referred to herein as “HPC”) applications, where data being accessed by a single application can reach many gigabytes to terabytes in magnitude. To allow for more control and optimize performance of HPC applications, another technique of buffering I/O includes Flexible File IO (FFIO), originally developed by Cray Research. FFIO allows a user to maintain an I/O cache between the user application and the default buffering I/O systems used by the kernel, and control the operating parameters of the buffers in the I/O cache by setting environment variables. The data in the FFIO buffers can then be transferred to and from the storage device with direct I/O, bypassing the kernel I/O buffers. To utilize FFIO, however, applications needed to explicitly link to the FFIO library.
In view of the above, it is clear that there is a need in the HPC industry to combine the universal and relinkless strengths of system I/O with the user-defined optimizations available through the FFIO library.